/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package slicktest.entities.ImmobileEntity.upgrades;

import java.util.List;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import slicktest.data.StatMod;
import slicktest.entities.ImmobileEntity.ImmobileEntity;
import slicktest.entities.ImmobileEntity.Tower;
import slicktest.types.DamageType;
import slicktest.util.StatModUtil;

/**
 *
 * @author enrightt
 */
public class ROFUpgrade implements ImmobileEntity {
    //tower that this ROFUpgrade decorates
    private Tower tower;

    private StatMod ROFMod;

    //how long this upgrade takes to make
    private double buildTime;
    private double cost;

    private String type;

    private List<String> restrictions;

    public ROFUpgrade(Tower t, StatMod ROFMod, double buildTime, double cost, String type, List<String> restrictions) {
        this.tower = t;
        this.ROFMod = ROFMod;
        this.buildTime = buildTime;
        this.cost = cost;
        this.type = type;
        this.restrictions = restrictions;
    }

    public double getROF() {
        return StatModUtil.aggregateDoubleStat(tower.getROF(), ROFMod);
    }

    public double getDamage() {
        return tower.getDamage();
    }

    public double getProjectileSpeed() {
        return tower.getProjectileSpeed();
    }

    public double getSplash() {
        return tower.getSplash();
    }

    public double getBuildTime() {
        return buildTime;
    }

    public double getCost() {
        return cost;
    }

    public boolean[][] getFootprint() {
        return tower.getFootprint();
    }

    public List<DamageType> getDamageTypes() {
        return tower.getDamageTypes();
    }

    public String getType() {
        return type;
    }

    public boolean isBuildable() {
        return tower.isBuildable();
    }

    public boolean isPassable() {
        return tower.isPassable();
    }

    public List<String> getRestrictions() {
        return restrictions;
    }

    public void update(GameContainer gc, int delta) throws SlickException {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public String toString() {
        return "ROFUpgrade{" + "tower=" + tower + "ROFMod=" + ROFMod + "buildTime=" + buildTime + "cost=" + cost + "type=" + type + "restrictions=" + restrictions + '}';
    }
}
